def is_prime(n):
    if n < 2:
        return False
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0:
            return False
    return True

def nearest_prime_number(words):
    number_dict = {"zero": 0, "one": 1, "two": 2, "three": 3, "four": 4, "five": 5, "six": 6, "seven": 7, "eight": 8, "nine": 9}
    number = ""
    for word in words:
        if word in number_dict:
            number += str(number_dict[word])
        else:
            return "wrong input"
    
    number = int(number)
    
    while True:
        if is_prime(number):
            return number
        number += 1
    
# Примеры использования:
print(nearest_prime_number(["one", "two", "three"]))  # Вывод: 127
print(nearest_prime_number(["nine", "nine", "two"]))  # Вывод: 991
print(nearest_prime_number(["nine", "9"]))  # Вывод: wrong input
